package com.rlf.sf.legacymapping.xml.object;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

import lombok.ToString;

@XStreamAlias("rbp-permission")
@ToString
public class RbpPermission {
	
	@XStreamAsAttribute
	@XStreamAlias("permission-type")
	private String permissionType;
	
	@XStreamAsAttribute
	@XStreamAlias("permission-string-value")
	private String permissionStringValue;
	
	@XStreamAsAttribute
	@XStreamAlias("message-key")
	private String messageKey;

	public String getPermissionType() {
		return permissionType;
	}

	public void setPermissionType(String permissionType) {
		this.permissionType = permissionType;
	}

	public String getPermissionStringValue() {
		return permissionStringValue;
	}

	public void setPermissionStringValue(String permissionStringValue) {
		this.permissionStringValue = permissionStringValue;
	}

	public String getMessageKey() {
		return messageKey;
	}

	public void setMessageKey(String messageKey) {
		this.messageKey = messageKey;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		RbpPermission lp = (RbpPermission) obj;
		return this.permissionType.equals(lp.permissionType) && this.permissionStringValue.equals(lp.permissionStringValue) && this.messageKey.equals(lp.messageKey);
	}
	
}
